//=============================================================================
// The Trader menu with a tab for the store and the perks
//=============================================================================
class SRGUIBuyMenu extends GUIBuyMenu;

function bool NotifyLevelChange()
{
	bPersistent = false;
	return true;
}
function InitTabs()
{
	c_Tabs.AddTab(PanelCaption[0], string(Class'SRKFTab_BuyMenu'),, PanelHint[0]);
	c_Tabs.AddTab(PanelCaption[1], string(Class'SRKFTab_Perks'),, PanelHint[1]);
}

function UpdateHeader()
{
	local int TimeLeftMin, TimeLeftSec;
	local string TimeString;

	if ( KFPlayerController(PlayerOwner()) == none || PlayerOwner().PlayerReplicationInfo == none ||
		 PlayerOwner().GameReplicationInfo == none )
	{
		return;
	}

	// Current Perk
	if ( KFPlayerController(PlayerOwner()).SelectedVeterancy != none )
    {
		CurrentPerkLabel.Caption = CurrentPerk$":" @ 
			KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkill.default.VeterancyName @ 
			LvAbbrString$
			KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkillLevel;
	}
    else
	{
		CurrentPerkLabel.Caption = CurrentPerk$":" @ NoActivePerk;
	}

	// Trader time left
	TimeLeftMin = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave / 60;
	TimeLeftSec = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave % 60;

	if ( TimeLeftMin < 1 )
	{
		TimeString = "00:";
	}
	else
	{
		TimeString = "0" $ TimeLeftMin $ ":";
	}

	if ( TimeLeftSec >= 10 )
	{
		TimeString = TimeString $ TimeLeftSec;
	}
	else
	{
		TimeString = TimeString $ "0" $ TimeLeftSec;
	}

	TimeLeftLabel.Caption = TraderClose @ TimeString;

	if ( KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave < 10 )
	{
		TimeLeftLabel.TextColor = RedColor;
	}
	else
	{
		TimeLeftLabel.TextColor = GreenGreyColor;
	}

	// Wave Counter
	WaveLabel.Caption = WaveString$":" @ (KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).WaveNumber + 1)$"/"$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).FinalWave;
}

defaultproperties
{
     Begin Object Class=SRKFQuickPerkSelect Name=QS
         WinTop=0.011906
         WinLeft=0.008008
         WinWidth=0.316601
         WinHeight=0.082460
         OnDraw=QS.MyOnDraw
     End Object
     QuickPerkSelect=SRKFQuickPerkSelect'PerksSimHostOrg.SRGUIBuyMenu.QS'

}
